<template>
	<view class="mainpadding beijingse">
		<view class="zhonghei titletext textcenter margin_top">实付金额</view>
		<view class="zhonghei textcenter margin_top fonweight" style="font-size: 71rpx;">￥{{pay_price}}</view>
		<view class="ffffff radius mainpadding margin_top4 flexbetween">
			<view class="flexleft">
				<image class="qibicon margin_right2" src="../static/image/system/qb.png" mode=""></image>
				<view class="xiaohei titletext">余额</view>
			</view>
			<u-icon name="checkmark-circle-fill" color="#FF7510" size="18"></u-icon>
		</view>
		<view class="gudingdb mainpadding">
			<view class="bigbtn" @click="pay">立即支付</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				order_id:"",
				pay_price:"",
			}
		},
		onLoad(options) {
			let data = JSON.parse(decodeURIComponent(options.msg))
			this.order_id = data.order_id
			this.pay_price = data.pay_price
		},
		methods: {
			pay(){
				uni.showLoading({
					mask:true,
					title:"请稍后"
				})
				httpRequest.request("/api/order/payment", 'POST', {
					pay_type:10,
					order_id:this.order_id
				}, false, false, true).then(res => {
					uni.hideLoading()
					httpRequest.toast(res.msg);
					if (res.code == 1) {
						setTimeout(()=>{
							uni.navigateBack(1)
						},1000)
					}
				}).catch(err => {
					uni.hideLoading()
					httpRequest.toast(err.msg);
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.qibicon {
		width: 40rpx;
		height: 40rpx;
	}
</style>